package a_airwar;

import java.awt.image.BufferedImage;

public abstract class FlyObj {
    private  /*protected*/ BufferedImage image;
    private /*protected */ int x;
    private /*protected*/ int y;
    private /*protected*/ int width;
    private/* protected*/ int height;
    private int life;


   /* public FlyObj() {
        this.x = x;
        this.y = y;
        this.height = height;
        this.width = width;
        this.image = image;
    }*/

    public FlyObj(int x, int y, BufferedImage image, int life) {
        this.x = x;
        this.y = y;
        this.image = image;
        this.width = image.getWidth();
        this.height = image.getHeight();
        this.life = life;
    }

    public abstract void move();

    public BufferedImage getImage() {
        return image;
    }

    public void setImage(BufferedImage image) {
        this.image = image;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getLife() {
        return life;
    }

    public void setLife(int life) {
        this.life = life;
    }
    //减少生命值的方法
    public void reduceLife() {
        this.setLife(getLife() - 1);
        /*this.life--;*/
    }
}
